﻿using RuoVea.ExDto;
using RuoVea.ExEnum;
using RuoVea.ExSugar.Dto;
using System.ComponentModel.DataAnnotations;

namespace RuoVea.OmiApi.Config.Service.Dto
{
    /// <summary>
    /// 查询
    /// </summary>
    public class SysConfigParam : PageParam
    {
        /// <summary>
        /// 名称
        /// </summary>

        public string Name { get; set; }

        /// <summary>
        /// 编码
        /// </summary>

        public string Code { get; set; }

        /// <summary>
        /// 是否是系统参数（Y-是，N-否）
        /// </summary>
        public YesOrNot? SysFlag { get; set; }
        /// <summary>
        /// 状态（字典 0正常 1停用 ）
        /// </summary>
        public YesOrNot? IsDisable { get; set; } = YesOrNot.N;

        /// <summary>
        /// 常量所属分类的编码，来自于“常量的分类”字典
        /// </summary>
        [MaxLength(50)]
        public string GroupCode { get; set; }
    }
    /// <summary>
    /// 返回模型
    /// </summary>
    public class SysConfigDto : EntityBaseDto
    {
        /// <summary>
        /// 名称
        /// </summary>
        [Required, MaxLength(50)]
        public string Name { get; set; }

        /// <summary>
        /// 编码
        /// </summary>
        [Required, MaxLength(50)]
        public string Code { get; set; }

        /// <summary>
        /// 属性值
        /// </summary>
        [MaxLength(50)]
        public string Value { get; set; }

        /// <summary>
        /// 是否是系统参数（Y-是，N-否）
        /// </summary>
        [MaxLength(5)]
        public YesOrNot? SysFlag { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [MaxLength(100)]
        public string Remark { get; set; }

        /// <summary>
        /// 状态（字典 0正常 1停用 ）
        /// </summary>
        public YesOrNot? IsDisable { get; set; } = YesOrNot.N;

        /// <summary>
        /// 常量所属分类的编码，来自于“常量的分类”字典
        /// </summary>
        [MaxLength(50)]
        public string GroupCode { get; set; }
        /// <summary>
        /// 排序
        /// </summary>
        public int Sort { get; set; } = 100;
    }

    /// <summary>
    /// 输入模型
    /// </summary>
    public class SysConfigInputDto  
    {
        /// <summary>
        /// 主键Id
        /// </summary>
        public long Id { get; set; }
        /// <summary>
        /// 名称
        /// </summary>
        [Required, MaxLength(50)]
        public string Name { get; set; }

        /// <summary>
        /// 编码
        /// </summary>
        [Required, MaxLength(50)]
        public string Code { get; set; }

        /// <summary>
        /// 属性值
        /// </summary>
        [MaxLength(50)]
        public string Value { get; set; }

        /// <summary>
        /// 是否是系统参数（Y-是，N-否）
        /// </summary>
        public YesOrNot? SysFlag { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [MaxLength(100)]
        public string Remark { get; set; }

        /// <summary>
        /// 状态（字典 0正常 1停用 ）
        /// </summary>
        public YesOrNot? IsDisable { get; set; } = YesOrNot.N;

        /// <summary>
        /// 常量所属分类的编码，来自于“常量的分类”字典
        /// </summary>
        [MaxLength(50)]
        public string GroupCode { get; set; }
        /// <summary>
        /// 排序
        /// </summary>
        public int Sort { get; set; } = 100;
    }
}
